﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppManager.Model
{

    public class Project : BaseModel
    {
        /// <summary>
        /// 唯一標識
        /// </summary>
        [MaxLength(50)]
        [Index(IsUnique = true)]
        public string Identity { get; set; }
        [MaxLength(100)]
        public string CertUrl { get; set; }
        [MaxLength(100)]
        public string CertPwd { get; set; }        
        [MaxLength(100)]
        public string SenderId { get; set; }
        [MaxLength(100)]
        public string Token { get; set; }
        [MaxLength(100)]
        public string PackageName { get; set; }
        /// <summary>
        /// 是否啟用gcm
        /// </summary>
        public bool IsUseGcm { get; set; }
        /// <summary>
        /// 是否啟用ios
        /// </summary>
        public bool IsUseApns { get; set; }
        /// <summary>
        /// 是否啟用signalr
        /// </summary>
        public bool IsUseSignalr { get; set; }
        /// <summary>
        /// gcm配置發生錯誤,導致不能使用時為true,否則的話是可以使用的,重新配置之後需要修改該字段為false,表示正常使用
        /// </summary>
        public bool GcmError { get; set; }
        /// <summary>
        /// apns配置發生錯誤,導致不能使用時為true
        /// </summary>
        public bool ApnsError { get; set; }
        [MaxLength(100)]
        public string SandBox_CertUrl { get; set; }
        [MaxLength(100)]
        public string SandBox_CertPwd { get; set; }
        /// <summary>
        /// 是否是正式环境
        /// 默认是false 表示ios沙箱环境
        /// </summary>
        public bool IsProduct { get; set; }
        /// <summary>
        /// 記錄配置信息錯誤(使用最後一次的覆蓋之前的即可)
        /// </summary>
        public string ApnsException { get; set; }
        public string GcmException { get; set; }        
    }
}
